package com.xhwl.data.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.AccountOpenAuth;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 第三方账号openId 与 系统账号绑定关系
 *
 * @description:
 * @author:
 * @create: 2020-11-25
 **/
@RestController
public interface IAccountOpenAuthService extends IService<AccountOpenAuth> {

    /**
     * 新增
     *
     * @param accountOpenAuth
     * @return
     */
    @RequestMapping(value = "/account-open-auth/create", method = RequestMethod.POST)
    ResultJson create(@RequestPart(value = "accountOpenAuth", required = true) AccountOpenAuth accountOpenAuth);

    /**
     * 修改
     *
     * @param accountOpenAuth
     * @return
     */
    @RequestMapping(value = "/account-open-auth/update", method = RequestMethod.POST)
    ResultJson update(@RequestPart(value = "accountOpenAuth") AccountOpenAuth accountOpenAuth);

    /**
     * 删除
     *
     * @param accountOpenAuth
     * @return
     */
    @RequestMapping(value = "/account-open-auth/delete", method = RequestMethod.POST)
    ResultJson delete(@RequestPart(value = "accountOpenAuth", required = true) AccountOpenAuth accountOpenAuth);

    /**
     * 查询某一条账号绑定数据
     *
     * @param accountOpenAuth
     * @return
     */
    @RequestMapping(value = "/account-open-auth/get-one", method = RequestMethod.POST)
    AccountOpenAuth getOne(@RequestPart(value = "accountOpenAuth", required = true) AccountOpenAuth accountOpenAuth);


    /**
     * 查询某个用户id所有绑定的三方账号
     *
     * @param accountId
     * @return
     */
    @GetMapping(value = "/account-open-auth/list")
    List<AccountOpenAuth> listBindOpen(@RequestParam("accountId") Integer accountId, @RequestParam(value = "appId", required = false) String appId);
}

